﻿<Page x:Class="Dispatchr.Client.Views.SettingsPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:ViewModels="using:Dispatchr.Client.ViewModels"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="using:Dispatchr.Client.Views"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:storeApps="using:Microsoft.Practices.Prism.StoreApps"
      xmlns:mvvm="using:Microsoft.Practices.Prism.Mvvm"
      mvvm:ViewModelLocator.AutoWireViewModel="True"
      Background="{StaticResource AppBackground}"
      mc:Ignorable="d">


    <Hub>
        <Hub.HeaderTemplate>
            <DataTemplate>
                <Image Margin="0,20,0,0"
                       HorizontalAlignment="Left"
                       Source="/Assets/Logos/PhoneLogo.png"
                       Stretch="None" />

            </DataTemplate>

        </Hub.HeaderTemplate>

        <HubSection Header="SETTINGS">
            <DataTemplate>
                <StackPanel>
                    <TextBlock Style="{StaticResource BodyTextBlockStyle}"
                               Margin="0,0,0,25"
                               TextWrapping="Wrap">
                        <TextBlock.Text>
                            Controls where Solarizr is pulling data from.
                        </TextBlock.Text>
                    </TextBlock>
                    <ToggleSwitch Header="Use Local/Sample Data"
                                  IsOn="{Binding LocalOnly, Mode=TwoWay}"
                                  OffContent="Using Service"
                                  OnContent="Using Local" />
                    <Button Command="{Binding LogoutCommand}"
                            HorizontalAlignment="Stretch"
                            Visibility="{Binding IsLoggedIn, Converter={StaticResource BooleanToVisibilityConverter}}">Log out</Button>
                    <Button Command="{Binding ClearLocalDbCommand}"
                            HorizontalAlignment="Stretch">Clear Local DB</Button>
                </StackPanel>
            </DataTemplate>
        </HubSection>
    </Hub>

</Page>
